package cn.ad.server.web.filter.bid;

import cn.ad.server.common.utils.SpringContextUtils;
import cn.ad.server.web.spring.service.actions.context.BidContext;
import cn.ad.server.biz.internal.AdService;
import cn.ad.server.domain.ad.Strategy;

/**
 * @author dongbin.yu
 * @from 2016-07-19
 * @since V1.0
 */
public class BalanceMatcher implements BidMatcherChain {


    private AdService adService;

    public BalanceMatcher() {
        this.adService = SpringContextUtils.getBean(AdService.class);
    }

    @Override
    public boolean match(Strategy strategy, BidContext context) {

        return adService.whetherHaveBalance(strategy);
    }
}
